//三国游戏
#include <iostream>
#include <algorithm>

using namespace std;

const int N = 1e5 + 10;

int a[N] , b[N] , c[N] , t[N] , n;

int get(int *x , int *y , int *z)
{
    for(int i = 1;i <= n;i ++)
    {
        t[i] = x[i] - y[i] - z[i];
    }
    sort(t + 1 , t + 1 + n , greater<>());
    for(int i = 1;i <= n;i ++)
    {
        t[i] += t[i - 1];
        if(t[i] <= 0) return i - 1;
    }
    return 0;
}
int main()
{
    cin >> n;
    for (int i = 1; i <= n; i ++) cin >> a[i];
    for (int i = 1; i <= n; i ++) cin >> b[i];
    for (int i = 1; i <= n; i ++) cin >> c[i];

    int res = max({get(a, b, c), get(b, a, c), get(c, a, b)});
    cout << (res == 0 ? -1 : res) << endl;
    return 0;
}